package com.fjec.market.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fjec.market.entity.BizPurchasing;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * <p>
 * 007.采购商采购需求表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2020-09-14
 */
public interface BizPurchasingMapper extends BaseMapper<BizPurchasing> {
    @Select("select purchasing.* from biz_purchasing purchasing, info_purchase purchase where purchasing.PurcId = purchase.Id and purchase.UserId=#{userId}")
    List<BizPurchasing> getPurchasingByUserId(@Param("userId") Long userId);

    @SelectProvider(type = com.fjec.market.mapper.sqlbuilder.PurchasingSqlBuilder.class, method = "get2PurchasingByPurchaseIds")
    List<BizPurchasing> get2PurchasingByPurchaseIds(@Param("purchaseIds") List<Long> purchaseIds);

    @SelectProvider(type = com.fjec.market.mapper.sqlbuilder.PurchasingSqlBuilder.class, method = "getPurchasingByPurchaseIds")
    List<BizPurchasing> getPurchasingByPurchaseIds(@Param("purchaseIds") List<Long> purchaseIds);
}
